<?php

class User_model{

	private $db;

	function __construct(){
		require_once('cruds.php');
		
		$this->db = new CRUDS();
	}
	
	function update_user($arr_set, $arr_param, $table){
		$this->db->update($arr_set, $arr_param, $table);
		
	}
	
	function get_user_pass($id_user){
		$this->db->select('*');
		$this->db->from('user');
		$this->db->where('IDUSER = '.$id_user);
		
		$query = $this->db->get();
		return $query;
	}
	
	function get_koperasi_data_from_iduser($id_user){
		$this->db->select('*');
		$this->db->from('koperasi');
		$this->db->where('IDUSER = '.$id_user);
		
		$query = $this->db->get();
		return $query;
	}
	
	function get_kota($id_kota){
		$this->db->select('*');
		$this->db->from('kota');
		$this->db->where('IDKOTA = '.$id_kota);
		
		$query = $this->db->get();
		return $query;
	}
	
	function get_besaran($id_besaran){
		$this->db->select('*');
		$this->db->from('besaran');
		$this->db->where('IDBESARAN = '.$id_besaran);
		
		$query = $this->db->get();
		return $query;
	}
	
	function get_prov($id_prov){
		$this->db->select('*');
		$this->db->from('provinsi');
		$this->db->where('IDPROPINSI = '.$id_prov);
		
		$query = $this->db->get();
		return $query;
	}

}

?>